local m = Map("cert", "配置证书")
local s = m:section(TypedSection, "cert")
s.addremove = true
s.anonymouse = true
local crt = s:option(FileUpload, "crt", "证书")
local key = s:option(FileUpload, "key", "密钥")
local gen = s:option(Button, "", "应用", "应用上方的证书和密钥，即使变量还没保存")
function gen.write(self, section)
    luci.model.uci:set("uhttpd", "main", "cert", crt:cfgvalue(section))
    luci.model.uci:set("uhttpd", "main", "key", key:cfgvalue(section))
    luci.model.uci:save("uhttpd")
    luci.model.uci:commit("uhttpd")
    luci.sys.call("sleep 0.1 && /etc/init.d/uhttpd restart &")
end
return m
